﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace EnterpriseFund.BLL
{
  
    /// <summary>
    /// HRDept
    /// </summary>
    public partial class HRDept
    {
        private readonly EnterpriseFund.DAL.HRDept dal = new EnterpriseFund.DAL.HRDept();
        public HRDept()
        { }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.HRDept GetModel(string FEntityNo, string FDeptNo)
        {

            return dal.GetModel(FEntityNo, FDeptNo);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.HRDept> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.HRDept> DataTableToList(DataTable dt)
        {
            List<EnterpriseFund.Model.HRDept> modelList = new List<EnterpriseFund.Model.HRDept>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                EnterpriseFund.Model.HRDept model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }


        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}
    }
}
